package com.dao;

import com.bean.LoginLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * @author cyf
 * @description
 * @create 2018-09-10 14:15
 **/
@Repository
public class LoginLogDao {
    
    private static final String INSERT_LOGIN_LOG_SQL = "insert into t_login_log (user_id,login_ip,login_date) values(?,?,?)";

    @Autowired
    private JdbcTemplate jdbcTemplate;

    public boolean insertLoginLog(LoginLog loginLog){
        return jdbcTemplate.update(INSERT_LOGIN_LOG_SQL, new Object[]{loginLog.getUserId(), loginLog.getLoginIp(), loginLog.getLoginDate()}) > 0;
    }

}
